/*
*  Copyright 2019-2023 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.biz.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
* @description /
* @author yiwei.he
* @date 2024-04-07
**/
@Data
@TableName("tz_prince_city_region")
public class PrinceCityRegion implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "自增ID")
    private Integer id;

    @NotNull
    @ApiModelProperty(value = "城市id")
    private Integer cityId;

    @NotNull
    @ApiModelProperty(value = "省市级别")
    private Integer level;

    @NotNull
    @ApiModelProperty(value = "父级id")
    private Integer parentId;

    @NotNull
    @ApiModelProperty(value = "parentArea")
    private Integer parentArea;

    @NotBlank
    @ApiModelProperty(value = "区号")
    private String areaCode;

    @NotBlank
    @ApiModelProperty(value = "名称")
    private String name;

    @NotBlank
    @ApiModelProperty(value = "合并名称")
    private String mergerName;

    @NotBlank
    @ApiModelProperty(value = "经度")
    private String lng;

    @NotBlank
    @ApiModelProperty(value = "纬度")
    private String lat;

    @NotNull
    @ApiModelProperty(value = "是否展示")
    private Integer isShow;

    public void copy(PrinceCityRegion source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
